package com.freight.core.common.utils;

import cn.hutool.http.HttpUtil;

import java.nio.charset.Charset;
import java.util.HashMap;

public class NetWorkUtil {

    public static void postRequest(){
        String result1= HttpUtil.get("https://www.baidu.com");
        System.out.println(result1);
        //可以单独传入http参数，这样参数会自动做URL编码，拼接在URL中
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("city", "北京");
        String result3= HttpUtil.get("https://www.baidu.com", paramMap);
        System.out.println(result3);

    }


    public static void main(String[] args){
        postRequest();
    }
}
